<?php 

class Admin_View_Helper_adminURL extends Zend_View_Helper_Abstract
{
    public function adminURL($controller = 'index', $action = '', $param = array(), $reset = true)
    {
    	$admin_url = array(
			'module' => 'admin',
			'controller' => $controller
		);
		if ($action != '')
			$admin_url['action'] = $action;
		if (!empty($param)) {
			if (is_numeric($param)) {
				$admin_url['id'] = $param;
			}else{
				$admin_url = array_merge($admin_url, $param);
			}
			
		}		
    	$view = Zend_Layout::getMvcInstance()->getView();
		$request = Zend_Controller_Front::getInstance()->getRequest();		
        return $request->getScheme() . '://' . $request->getHttpHost()  . $view->url($admin_url, null, $reset);
    }
}